package com.hrc.rpc.registry;


import com.hrc.rpc.common.ServiceMeta;

import java.io.IOException;
import java.util.List;

/**
 * 注册中心接口
 */
public interface RegistryService {

    /**
     * 服务注册
     */
    void register(ServiceMeta serviceMeta) throws Exception;

    /**
     * 服务注销
     */
    void unRegister(ServiceMeta serviceMeta) throws Exception;


    /**
     * 获取 serviceName 下的所有服务
     */
    List<ServiceMeta> discoveries(String serviceName);

    /**
     * 关闭
     */
    void destroy() throws IOException;
}
